import java.util.Scanner;

/**
 * Created by dllo on 18/3/29.
 */
public class Question03 {
    public static void main(String[] args) {
//迭代 i是控制  循环次数的 尽量不要改变迭代变量
        for (int i = 100; i < 1000; ++i) {
            int rawi = i;
            int raw100 = rawi / 100;//求百位数
            rawi = rawi % 100;//求百位的模
            int rawi10 = rawi / 10;
            rawi %= 10;
            if (i == raw100 * raw100 * raw100 + rawi10 * rawi10 * rawi10 +
                    rawi * rawi * rawi) {
                System.out.println(i);
            }
        }
    }
}




